package com.esd.crm.controller;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.esd.crm.entity.District;
import com.esd.crm.service.DistrictService;

@RestController
@RequestMapping("/security")
public class DistrictController {
	private static final Logger logger = LogManager.getLogger(DistrictController.class);

	@Autowired
	private DistrictService districtService;

	/**
	 * 获取黑龙江省所有市的信息
	 */
	@GetMapping("/district")
	public List<District> district(@RequestParam Integer code) {
		logger.info("查询省市区");
		return districtService.selectByParentId(code);
	}

}
